package com.fifth.order.config;

import org.redisson.Redisson;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @作者：刘壬杉
 * @创建时间 2022/9/8 10:02
 **/
@Configuration
public class RedissionConfig {
    @Bean
    public Redisson redisson(){
        Config config =new Config();
        config.useSingleServer().
                setAddress("redis://192.168.1.28:6379").
                //redis默认有16个数据库
                        setDatabase(0);
        return (Redisson) Redisson.create(config);
    }
}
